<template>
	<view class="container">
		<my-search @open="open"></my-search>

		<uni-popup type="bottom" ref="popup" background-color="#fff" mask-click="true">
			<view class="bottom-popup">
				<my-popup :popupList="searchList" @close="close" :wh="wh"></my-popup>
			</view>
		</uni-popup>
		<view class="hisoty">
			<view class="search-hisoty" v-for="(n,i) in searchHisoty" :key="i">
				{{n}}
			</view>
		</view>
		<view class="employee" >
			<HousekeeperList :list='housekeeperList' @click='toMatenity'/>
		</view>
	</view>
</template>

<script>
	import HousekeeperList from '@/components/housekeeperList/housekeeperList.vue'
	export default {
		components:{
			HousekeeperList
		},
		data() {
			return {
				wh: 0,
				searchHisoty: ['月嫂', '保姆', '产康师', '育婴师', '家装/搬家', '早教/托育', '养老/陪护', '保洁/清洗', '全部职业'],
				
				housekeeperList:[
					{
						id:1,
						name:'张丽丽',
						price:'8000元/26天',
						status:['二星育婴师','6年经验'],
						text:'湖南长沙 | 41岁 | 服务13户 | 评价13条',
						image:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fci.xiaohongshu.com%2F70897d99-67d9-7d59-b780-c37b04dc4ac1%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fci.xiaohongshu.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668411913&t=32e95ac54897e295befe35044327e42d'
					},
					{
						id:1,
						name:'张丽丽',
						price:'8000元/26天',
						status:['二星育婴师','6年经验'],
						text:'湖南长沙 | 41岁 | 服务13户 | 评价13条',
						image:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fepaper.zzxw.net%2Fresfile%2F2021-10-12%2F03%2Fzz1012003_002_01_b.jpg&refer=http%3A%2F%2Fepaper.zzxw.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668411944&t=d49db42d4f1a1e0bbd1dab7912b721cd'
					},
					{
						id:1,
						name:'张丽丽',
						price:'8000元/26天',
						status:['二星育婴师','6年经验'],
						text:'湖南长沙 | 41岁 | 服务13户 | 评价13条',
						image:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg1.gtimg.com%2Fnews%2Fpics%2Fhv1%2F134%2F154%2F2225%2F144720029.png&refer=http%3A%2F%2Fimg1.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668411964&t=a523765bbe6fb74f2c1cb5e654c10139'
					},
					{
						id:1,
						name:'张丽丽',
						price:'8000元/26天',
						status:['二星育婴师','6年经验'],
						text:'湖南长沙 | 41岁 | 服务13户 | 评价13条',
						image:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fp9.itc.cn%2Fimages01%2F20211004%2F80a1fadcb4d3415f91318ba937761fbd.png&refer=http%3A%2F%2Fp9.itc.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668411982&t=f679a24ed16f6bddb846f4141762c18b'
					}
				],
							
				searchList: [{
						id: 1,
						name: '职业类型',
						data: ['全部职业', '月嫂', '育婴师', '保洁/清洁阿姨', '保姆', '产康师', '早教', '养老']
					},
					{
						id: 2,
						name: '学历',
						data: ['小学', '初中', '中专', '职高', '高中', '大专', '本科', '研究生及以上']
					},
					{
						id: 3,
						name: '民族',
						data: ['汉族', '蒙古族', '回族', '藏族', '维吾尔族', '苗族', '彝族', '壮族']
					},
					{
						id: 4,
						name: '婚姻状况',
						data: ['已婚', '未婚', '离异', '丧偶']
					},
					{
						id: 5,
						name: '生肖',
						data: ['鼠', '牛', '虎', '兔', '龙', '蛇', '马', '猴']
					},
					{
						id: 6,
						name: '工作年限',
						data: ['1年', '2年', '3年', '4年', '5年', '6年', '7年', '8年']
					}
				]
			
			
			};
		},
		onLoad() {
			const sysInfo = uni.getSystemInfoSync()
			this.wh = sysInfo.windowHeight - 42
		},
		methods: {
			open() {
				// 通过组件定义的ref调用uni-popup方法 ,如果传入参数 ，type 属性将失效 ，仅支持 ['top','left','bottom','right','center']
				this.$refs.popup.open('buttom')
			},
			close() {
				this.$refs.popup.close()
			},
			toMatenity(item){
				wx.navigateTo({
					url:'/subpkg/maternity/maternity?women='
				})
			}
			
		}
	}
</script>

<style lang="scss">
	.container {
	.employee{
		background-color: #fff;
	}
	.hisoty {
		display: flex;
		align-content: flex-start;
		flex-flow: row wrap;
		background-color: #FFFFFF;
		margin-bottom: 10px;

		.search-hisoty {
			box-sizing: border-box;
			border: 1px solid #aaaaaa;
			padding: 0 15px;
			border-radius: 10px;

			font-size: 12px;
			margin: 10px;
			margin-bottom: 5px;
			height: 22px;
		}
	}
	}
</style>
